package com.scott.juc.executor;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author Scott 2017/11/2 09:06
 */
public class ExecutorServiceDemo {

    public static void main(String[] args) {

        ExecutorService service = Executors.newFixedThreadPool(2);


        for(int i=0;i<10;i++){
            Runnable runner = new Runner(i);

            service.submit(runner);

        }

        service.shutdown();

    }


}
